<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@include file="common.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html style="font-size: 100px;">
  <head>
    <base href="<%=basePath%>">
    
    <title>智慧消防</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	  <link rel="stylesheet" href="<%=request.getContextPath()%>/css/amazeui.min.css" type="text/css"></link>
	  <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	  <script type="text/javascript" src="<%=request.getContextPath()%>/js/wxConfig.js"></script>

	<script>
	   var sub = '';
        //  扫描二维码，type 1：设备，2：子设备
        function scanCode(type){
    		wx.ready(function () {
                 wx.scanQRCode({
                     	/* 默认为0，扫描结果由微信处理，1则直接返回扫描结果 */
                       needResult : 1,
                       scanType: ["qrCode","barCode"],
                       success : function(res) {
                            var url = res.resultStr;
                            var urlStr = url.split(',');
                            var resData = eval("(" + urlStr + ")");
                            var deviceId = resData.deviceId;
                            if(deviceId ==''){
                            	myAlert("设备Id为空");
                            	return ;
                            }
							if(type==1){
								if(sub == 'device'){
                                    location.href = '<%=path%>/login/device.jsp?deviceId='+deviceId;
                                }else if(sub == 'vehicle'){
                                    location.href = '<%=path%>/login/vehicle.jsp?deviceId='+deviceId;
                                } else if(sub == 'master') {
                                    location.href = '<%=path%>/login/master.jsp?deviceId='+deviceId;
								} else if(sub == 'windpower') {
                                    location.href = '<%=path%>/login/windpower.jsp?deviceId='+deviceId;
                                }
							} else{
								if(sub == 'device'){
									location.href = '<%=path%>/login/subdevice.jsp?deviceId='+deviceId;
								} else if(sub == 'vehicle'){
                                    location.href = '<%=path%>/login/subvehicle.jsp?deviceId='+deviceId;
                                } else if(sub == 'master') {
                                    location.href = '<%=path%>/login/submaster.jsp?deviceId='+deviceId;
								} else if(sub == 'windpower') {
                                    location.href = '<%=path%>/login/subwindpower.jsp?deviceId='+deviceId;
                                }
							}
                       }
                   });
           	 });
        }
		
		$(document).ready(function(){
		  $(".hideLy").click(function(){
              hideButton();
	      });

	      $("#firstImg").click(function(){
	      	sub = 'device';
	      	showButton();
	      });
	      
	      $("#secondImg").click(function(){
	      	sub = 'vehicle';
	      	showButton();
	      });

		$("#thirdImg").click(function(){
			sub = 'master';
			showButton();
		});

		$("#fourImg").click(function(){
            sub = 'windpower';
            showButton();
		});

		$("#fiveImg").click(function(){
            myAlert("暂未开发");
		});

		$(".m-button").click(function(){
			hideButton();
		});
	    });

	   function hideButton (){
           $("#ly").hide();
           $(".m-button").hide();
       }

       function showButton (){
           $("#ly").show();
           $(".m-button").toggle();
       }
    </script>
    <style>
    	.am-slides img{
    		height: 1.6rem;
    	}
        .image {
            width: 50%;
            height: 1.2rem;
            border-radius: 2px;
			float: left;
        }
		.t-name{
			/*position: fixed;*/
			margin-top: 0.1rem;
			margin-left: 0.2rem;
			color: white;
			font-size: 0.18rem;
		}
		.m-button{
			position: fixed;
			z-index: 3;
			display: none;
			background-color: #efeeec;
			width: 100%;
			text-align: center;
			bottom: 46px;
			font-size: 0.2rem;
			font-family: "微软雅黑";
		}
		.m-button div{
			border-top:1px solid #D9D9D9;
			line-height: 0.5rem;
			background-color: white;
			border-radius: 5px;
		}
		.tradeCodes {
			position: relative;
			height: 1rem;
			width: 49.8%;
			float: left;
			background-size:cover;
			margin: 0 0 4px 0;border-radius: 4px;
			pointer-events: none;
		}
		.bg{
			position: absolute;
			width: 100%;
			height: 1rem;
			background-color: rgba(208, 204, 204, 0.6);
			top: 0px;
		}
    </style>
</head>
<body>
<div style="display: inline;">
	<div data-am-widget="slider" class="am-slider am-slider-a1" data-am-slider='{"directionNav":false}' >
	    <ul class="am-slides">
	        <li>
	            <img src="<%=path %>/images/index/sf1.jpg"></img>
	        </li>
	        <li>
	            <img src="<%=path %>/images/index/sf2.jpg"></img>
	        </li>
	        <li>
	            <img src="<%=path %>/images/index/sf3.jpg"></img>
	        </li>
	    </ul>
	</div>
	<div style="padding: 10px 0px 10px 0px;overflow: hidden;">
		<div style="background-image: url('<%=path %>/images/main/index1.jpg');margin-right: 0.4%;" class="tradeCodes tradeCodes_1" id="firstImg">
			<div class="t-name">九小场所</div>
			<div class="bg"></div>
		</div>
		<div style="background-image: url('<%=path %>/images/main/index2.jpg');" class="tradeCodes tradeCodes_2" id="secondImg" >
			<div class="t-name">智慧公交</div>
			<div class="bg"></div>
		</div>
		<div style="background-image: url('<%=path %>/images/main/index3.jpg');margin-right: 0.4%" class="tradeCodes tradeCodes_3" id="thirdImg" >
			<div class="t-name">房车营地</div>
			<div class="bg"></div>
		</div>
		<div style="background-image: url('<%=path %>/images/main/index4.jpg');" class="tradeCodes tradeCodes_5" id="fourImg" >
			<div class="t-name">风电</div>
			<div class="bg"></div>
		</div>
		<div style="background-image: url('<%=path %>/images/main/index5.jpg');margin-right: 0.4%" class="tradeCodes tradeCodes_4" id="fiveImg" >
			<div class="t-name">管廊</div>
			<div class="bg"></div>
		</div>
	</div>
	<%--<<div class="tradeCodes">
        <div class="t-name">房车营地</div>
        <img src="<%=path %>/images/main/index1.jpg" class="image" id="firstImg" ></img>
    </div>
    div class="tradeCodes">
        <div class="t-name">智慧公交</div>
        <img src="<%=path %>/images/main/index21.jpg" class="image" id="secondImg" ></img>
    </div>
    <div class="tradeCodes">
        <div style="position: absolute;" class="t-name">房车营地</div>
        <img src="<%=path %>/images/main/index31.jpg" class="image" id="thirdImg" ></img>
    </div>
    <div class="tradeCodes">
        <div class="t-name">风电</div>
        <img src="<%=path %>/images/main/index3q.jpg" class="image" id="fourImg" ></img>
    </div>
    <div class="tradeCodes">
        <div class="t-name">管廊</div>
        <img src="<%=path %>/images/main/index3q.jpg" class="image" id="fiveImg" ></img>
    </div>--%>
</div>
<div style="height: 46px;"></div>
<!--灰色背景层-->  
<div id="ly" class="hideLy" style="position:fixed; top:0; left:0; z-index:2; width:100%; height:100%; background:#444; filter:alpha(opacity=100); opacity:0.7;display: none;"> 
</div>
<div class="m-button">
	<div onclick="scanCode('1')">
		扫描设备二维码
	</div>
	<div onclick="scanCode('2')">
		扫描子设备二维码
	</div>
	<div class="hideLy" style="margin-top: 5px;">
		取消
	</div>
</div>
<div>
	<ul id="common-bottom" class="am-avg-sm-3">
	    <li>
	        <a class="bottom-active"><img class="am-thumbnail" src="<%=path %>/images/nav/home_select.png"></img>首页</a>
	    </li>
		<li>
			<a href="<%=path%>/login/maintenanceTask.jsp "><img class="am-thumbnail" src="<%=path %>/images/nav/maintenance_normal.png"></img>巡检</a>
		</li>
	    <li>
	        <a href="<%=path%>/login/operationList.jsp "><img class="am-thumbnail" src="<%=path %>/images/nav/operationList_normal.png"></img>维修</a>
	    </li>
		<li>
			<a href="<%=path%>/login/mine.jsp "><img class="am-thumbnail" src="<%=path %>/images/nav/mine_normal.png"></img>我</a>
		</li>
	</ul>
</div>
</body>
</html>